/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.basicdata.basictree.entity;

import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.sys.entity.User;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jeeplus.core.persistence.TreeEntity;

/**
 * 设备节点Entity
 * @author 李宏博
 * @version 2020-09-28
 */
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler"})
public class PartDeviceNode extends TreeEntity<PartDeviceNode> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// 设备编码
	private String level;		// 设备层级
	private String erpMaterialId;		// 物料编码
	private String type;		// 类别
	private String purpose;		// 用途
	private String lifeCycle;		// 使用周期
	private String comsumeQuota;		// 消耗定额
	@ExcelField(title="责任人", fieldType=User.class, value="duty.name", align=2, sort=10)
	private User duty;		// 责任人
	private String runState;		// 运行状态
	private String isShow;		// 是否显示
	private String isLeaf;		// 是否叶节点
	private String grade;		// 设备级别
	private String isIot;		// 是否是物联设备
	private Boolean hasChildren = true;	//	是否有孩子，为树形table准备
	
	private String beginLifeCycle;		// 开始 使用周期
	private String endLifeCycle;		// 结束 使用周期
	
	public PartDeviceNode() {
		super();
	}

	public PartDeviceNode(String id){
		super(id);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}
	
	public String getErpMaterialId() {
		return erpMaterialId;
	}

	public void setErpMaterialId(String erpMaterialId) {
		this.erpMaterialId = erpMaterialId;
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public String getPurpose() {
		return purpose;
	}

	public void setPurpose(String purpose) {
		this.purpose = purpose;
	}
	
	public String getLifeCycle() {
		return lifeCycle;
	}

	public void setLifeCycle(String lifeCycle) {
		this.lifeCycle = lifeCycle;
	}
	
	public String getComsumeQuota() {
		return comsumeQuota;
	}

	public void setComsumeQuota(String comsumeQuota) {
		this.comsumeQuota = comsumeQuota;
	}

	public User getDuty() {
		return duty;
	}

	public void setDuty(User duty) {
		this.duty = duty;
	}
	
	public String getRunState() {
		return runState;
	}

	public void setRunState(String runState) {
		this.runState = runState;
	}
	
	public String getIsShow() {
		return isShow;
	}

	public void setIsShow(String isShow) {
		this.isShow = isShow;
	}
	
	public String getIsLeaf() {
		return isLeaf;
	}

	public void setIsLeaf(String isLeaf) {
		this.isLeaf = isLeaf;
	}
	
	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}
	
	public String getIsIot() {
		return isIot;
	}

	public void setIsIot(String isIot) {
		this.isIot = isIot;
	}
	
	public  PartDeviceNode getParent() {
			return parent;
	}
	
	@Override
	public void setParent(PartDeviceNode parent) {
		this.parent = parent;
		
	}
	
	public String getBeginLifeCycle() {
		return beginLifeCycle;
	}

	public void setBeginLifeCycle(String beginLifeCycle) {
		this.beginLifeCycle = beginLifeCycle;
	}
	
	public String getEndLifeCycle() {
		return endLifeCycle;
	}

	public void setEndLifeCycle(String endLifeCycle) {
		this.endLifeCycle = endLifeCycle;
	}
		
	public String getParentId() {
		return parent != null && parent.getId() != null ? parent.getId() : "0";
	}

	public Boolean getHasChildren() {
		return hasChildren;
	}

	public void setHasChildren(Boolean hasChildren) {
		this.hasChildren = hasChildren;
	}
}